<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>
<html>
<head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">

    <link href="jquery/bootstrap_3.3.0/css/bootstrap.min.css" type="text/css" rel="stylesheet"/>
    <link href="jquery/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css" type="text/css"
          rel="stylesheet"/>
    <!--日历功能的CSS-->
    <link rel="stylesheet" type="text/css"
          href="jquery/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css">
    <!--分页功能的CSS-->
    <link rel="stylesheet" type="text/css"
          href="jquery/bs_pagination-master/css/jquery.bs_pagination.min.css">

    <script type="text/javascript" src="jquery/jquery-1.11.1-min.js"></script>
    <script type="text/javascript" src="jquery/bootstrap_3.3.0/js/bootstrap.min.js"></script>
    <script type="text/javascript"
            src="jquery/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js"></script>
    <!--日历功能的js-->
    <script type="text/javascript" src="jquery/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js"></script>
    <!--日历功能语言类型的js-->
    <script type="text/javascript"
            src="jquery/bootstrap-datetimepicker-master/locale/bootstrap-datetimepicker.zh-CN.js"></script>

    <script type="text/javascript"
            src="jquery/bootstrap-datetimepicker-master/locale/bootstrap-datetimepicker.zh-CN.js"></script>
    <!--分页功能的js-->
    <script type="text/javascript"
            src="jquery/bs_pagination-master/js/jquery.bs_pagination.min.js"></script>
    <!--分页功能语言的js-->
    <script type="text/javascript" src="jquery/bs_pagination-master/localization/en.min.js"></script>


    <script type="text/javascript">

        $(function () {
            //弹出创建的模态窗口
            $("#createBtn").click(function () {
                //初始化工作
                //用户添加完表单之后将添加的信息删除
                $("#createClueFrom")[0].reset();
                //点击后显示模态窗口
                $("#createClueModal").modal("show");
            });

            // 当页面加载进来的时候，调用queryActivityByConditionForPage(1,10);方法，查询数据并刷新页面
            queryActivityByConditionForPage(1, 10);

            //实现保存线索工能
            $("#saveClueBtn").click(function () {
                //收集参数
                var fullname = $.trim($("#create-fullname").val());
                var appellation = $("#create-appellation").val();
                var owner = $("#create-owner").val();
                var company = $.trim($("#create-company").val());
                var job = $.trim($("#create-job").val());
                var email = $.trim($("#create-email").val());
                var phone = $.trim($("#create-phone").val());
                var website = $.trim($("#create-website").val());
                var mphone = $.trim($("#create-mphone").val());
                var state = $("#create-state").val();
                var source = $("#create-source").val();
                var description = $.trim($("#create-describe").val());
                var contactSummary = $.trim($("#create-contactSummary").val());
                var nextContactTime = $.trim($("#create-nextContactTime").val());
                var address = $.trim($("#create-address").val());
                //表单验证(作业)

                //对收集的参数进行判断
                if (owner == "") {
                    alert("所有者不能为空！");
                    return;
                }
                if (company == "") {
                    alert("公司不能为空！");
                    return;
                }
                if (fullname == "") {
                    alert("姓名不能为空！");
                    return;
                }
                var regExp1 = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
                if (!regExp1.test(email)) {
                    alert("请输入一个正确的邮箱！");
                    return;
                }

                var regExp2 = /^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/;
                if (!regExp2.test(mphone)) {
                    alert("请输入一个正确手机号码！");
                    return;
                }

                var regExp3 = /\d{3}-\d{8}|\d{4}-\d{7}/;
                if (!regExp3.test(phone)) {
                    alert("请输入一个正确电话号码！");
                    return;
                }

                var regExp4 = /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/;
                if (!regExp4.test(website)) {
                    alert("请输入一个正确公司网址！");
                    return;
                }

                // 提交ajax
                $.ajax({
                    url: 'workbench/clue/saveCreateClue.do',
                    data: {
                        fullname: fullname,
                        appellation: appellation,
                        owner: owner,
                        company: company,
                        job: job,
                        email: email,
                        phone: phone,
                        website: website,
                        mphone: mphone,
                        state: state,
                        source: source,
                        description: description,
                        contactSummary: contactSummary,
                        nextContactTime: nextContactTime,
                        address: address
                    },
                    type: 'post',
                    dataType: 'json',
                    success: function (data) {
                        if (data.code == "1") {
                            $("#createClueModal").modal("hide");
                            //刷新页面，显示第一页数据（分页）
                            queryActivityByConditionForPage(1, 10);
                        } else {
                            alert(data.message);
                            $("#createClueModal").modal("show");
                        }
                    }
                });
            });

            // 当容器加载完之后，对容器调用工具函数
            $("#create-nextContactTime,#edit-nextContactTime").datetimepicker({
                language: 'zh-CN',//1.设置语言
                format: 'yyyy-mm-dd',//2.显示日期的格式
                minView: 'month',//3.显示到最小的窗口
                initData: new Date(),//4.显示的初始的日期
                autoclose: true,//5.选择完日期后是否自动关闭
                todayBtn: true,//6.是否开启“今天选择按钮”
                clearBtn: true,//7.是否开启清空按钮
            });

            //对分页查询按钮进行绑定并调用函数实现查询功能
            $("#queryClueBtn").click(function () {
                // 点击查询按钮，查询所有符合条件的第一页，以及所有符合条件的数据的总数
                // 获取每页显示条数
                queryActivityByConditionForPage(1, $("#cluePage").bs_pagination('getOption', 'rowsPerPage'));
            });

            // 给全选按钮添加单击事件
            $("#checkedAll").click(function () {
                // 设置页面上checkbox的状态与全选按钮一致
                $("#tBody input[type='checkbox']").prop("checked", this.checked);
            })

            // 设置checkbox与全选按钮的关系，当checkbox全选时，全选按钮选中，否则不选中
            $("#tBody").on('click', 'input[type="checkbox"]', function () {
                var checkboxSize = $("#tBody input[type='checkbox']").size();
                var checkboxedSize = $("#tBody input[type='checkbox']:checked").size();
                if (checkboxSize == checkboxedSize) {
                    $("#checkedAll").prop("checked", true);
                } else {
                    $("#checkedAll").prop("checked", false);
                }
            });



            //实现弹出修改模态窗口将对应修改的表单数据显示出来
            $("#editBtn").click(function () {
                //收集参数
                //获取选中选择器的id,同时选择器只能选择一个
                var checkedId = $("#tBody input[type='checkbox']:checked");
                if (checkedId.size() == 0) {
                    alert("请选择一个线索！");
                    return;
                }
                if (checkedId.size() > 1) {
                    alert("只能选择一个！");
                    return;
                }
                var id = checkedId.val();

                //发送ajax
                $.ajax({
                    url: 'workbench/clue/queryClueById.do',
                    data: {
                        id: id
                    },
                    type: 'post',
                    dataType: 'json',
                    success: function (data) {
                        //发送参数
                        $("#edit-id").val(data.id);//id
                        $("#edit-clueOwner").val(data.owner);//owner
                        $("#edit-company").val(data.company);//name
                        $("#edit-call").val(data.appellation);//startDate
                        $("#edit-surname").val(data.fullname);
                        $("#edit-job").val(data.job);//cost
                        $("#edit-email").val(data.email);
                        $("#edit-phone").val(data.phone);
                        $("#edit-mphone").val(data.mphone);
                        $("#edit-website").val(data.website);
                        $("#edit-status").val(data.state);
                        $("#edit-source").val(data.source);
                        $("#edit-describe").val(data.description);
                        $("#edit-contactSummary").val(data.contactSummary);
                        $("#edit-nextContactTime").val(data.nextContactTime);
                        $("#edit-address").val(data.address);
                        //弹出模态窗口
                        $("#editClueModal").modal("show");
                    }
                });
            });

            //实现保存修改Clue数据功能
            $("#saveUpdateClueBtn").click(function () {
                //传递参数
                var id = $("#edit-id").val();
                var fullname =  $.trim($("#edit-surname").val());
                var appellation =  $.trim($("#edit-call").val());
                var owner = $("#edit-clueOwner").val();
                var company = $.trim($.trim($("#edit-company").val()));
                var job =  $.trim($("#edit-job").val());
                var email =  $.trim($("#edit-email").val());
                var phone =  $.trim($("#edit-phone").val());
                var website =  $.trim($("#edit-website").val());
                var mphone = $.trim($("#edit-mphone").val());
                var state = $("#edit-status").val();
                var source = $("#edit-source").val();
                var description = $.trim($("#edit-describe").val());
                var contactSummary = $.trim($("#edit-contactSummary").val());
                var nextContactTime = $.trim($("#edit-nextContactTime").val());
                var address = $.trim($("#edit-address").val());
                //根据要求对收集到的数据进行判断
                if (owner == "") {
                    alert("所有者不能为空！");
                    return;
                }
                if (company == "") {
                    alert("公司不能为空！");
                    return;
                }
                if (fullname == "") {
                    alert("姓名不能为空！");
                    return;
                }
                $.ajax({
                    url: 'workbench/clue/saveUpdateClueById.do',
                    data: {
                        id:id,
                        fullname:fullname,
                        appellation:appellation,
                        owner:owner,
                        company:company,
                        job:job,
                        email:email,
                        phone:phone,
                        website:website,
                        mphone:mphone,
                        state:state,
                        source:source,
                        description:description,
                        contactSummary:contactSummary,
                        nextContactTime:nextContactTime,
                        address:address
                    },
                    type: "post",
                    dataType: "json",
                    success: function (data) {
                        if (data.code == "1") {
                            //关闭模态窗口
                            $("#editClueModal").modal("hide");
                            //刷新市场活动，显示第当前页数据，保持每页显示条数不变
                            queryActivityByConditionForPage($("#cluePage").bs_pagination('getOption', 'currentPage'), $("#cluePage").bs_pagination('getOption', 'rowsPerPage'));
                        } else {
                            alert(data.message);
                            $("#editClueModal").modal("show");
                        }
                    }
                });
            });

            //实现删除功能
            $("#deleteClueBtn").click(function (){
                //判断有没有选择框选中
                var checkedIds = $("#tBody input[type='checkbox']:checked");
                if (checkedIds.size() == 0) {
                    alert("请选择一个线索！");
                    return;
                }
                //确认是否删除市场活动
                if (window.confirm("确认删除吗?")) {
                    //将选中的选择框的id值（需要拼接）传到后端
                    var ids = "";
                    $.each(checkedIds, function () {//字符串形式为：id=xxx&id=xxx...&;注意最后一个&不要
                        ids += "id=" + this.value + "&";
                    });
                    //substr的作用是去除最后一个&
                    ids = ids.substr(0, ids.length - 1);

                    //发送ajax请求
                    $.ajax({
                        url: 'workbench/clue/deleteClueById.do',
                        data: ids,//这里的ids如果用之前的方式会导致数据被覆盖
                        type: 'post',
                        dataType: 'json',
                        success: function (data) {
                            if (data.code == "1") {
                                //刷新市场活动，显示第一页数据，保持每页显示条数不变
                                queryActivityByConditionForPage(1, $("#cluePage").bs_pagination('getOption', 'rowsPerPage'));
                            } else {
                                alert(data.message);
                            }
                        }
                    });
                }
            });
        });

        //实现分页功能
        function queryActivityByConditionForPage(pageNo, pageSize) {
            var fullname = $("#query-fullname").val();
            var company = $("#query-company").val();
            var phone = $("#query-phone").val();
            var mphone = $("#query-mphone").val();
            var source = $("#query-source").val();
            var owner = $("#query-owner").val();
            var state = $("#query-state").val();
            //如果要实现分页的功能，那么这两个参数肯定不能写死
            // var pageNo = 1;
            // var pageSize = 10;


            $.ajax({
                url: "workbench/clue/queryAllClues.do",
                data: {
                    fullname: fullname,
                    company: company,
                    phone: phone,
                    mphone: mphone,
                    source: source,
                    owner: owner,
                    state: state,
                    pageNo: pageNo,
                    pageSize: pageSize
                },
                type: 'post',
                dataType: 'json',
                success: function (data) {
                    //将数据库里的数据通过each循环到页面上
                    var htmlStr = "";
                    $.each(data.clueList, function (index, obj) {
                        htmlStr += "<tr class=\"active\">";
                        htmlStr += "<td><input type=\"checkbox\" name='id' value=" + obj.id + "></td>";
                        htmlStr += "<td><a style=\"text-decoration: none; cursor: pointer;\" onclick=\"window.location.href='workbench/detail/queryClueRemarkByClueId.do?id=" + obj.id + "';\">" + obj.fullname + obj.appellation + "</a></td>";
                        htmlStr += "<td>" + obj.company + "</td>";
                        htmlStr += "<td>" + obj.phone + "</td>";
                        htmlStr += "<td>" + obj.mphone + "</td>";
                        htmlStr += "<td>" + obj.source + "</td>";
                        htmlStr += "<td>" + obj.owner + "</td>";
                        htmlStr += "<td>" + obj.state + "</td>";
                        htmlStr += "</tr>";
                    });
                    $("#tBody").html(htmlStr);

                    //使用分页功能以后要将选择器重新变为未选中的状态
                    $("#checkedAll").prop("checked", false);

                    //此处是计算总页数;只有除完为整数才能用
                    //parseInt：该函数为js的系统函数，作用是取小数中的整数部分
                    var totalPages = 1;
                    if (data.totalRows % pageSize == 0) {
                        totalPages = data.totalRows / pageSize;
                    } else {
                        totalPages = parseInt(data.totalRows / pageSize) + 1;
                    }

                    //当ajax完成后再使用分页查询，这时pageNo和pageSize两个参数才会显示出来
                    //在此处使用分页函数
                    $("#cluePage").bs_pagination({
                        currentPage: pageNo,//当前页号，相当于PageNo
                        rowsPerPage: pageSize,//每页显示的数据数,相当于PageSize
                        totalRows: data.totalRows,//总条数
                        totalPages: totalPages,//总页数，必填参数，没有默认值
                        visiblePageLinks: 5,//最多可以显示的卡片数

                        showGoToPage: true,//boolean值，是否显示跳转的“跳转到”的部分,默认true
                        showRowsPerPage: true,//是否显示“每页显示条数”部分，默认true--显示
                        showRowsInfo: true,//是否显示记录信息，默认为true

                        //用户每次切换页号，都会执行本段函数
                        //每次切换页号之后，返回的pageNo和pageSize
                        onChangePage: function (event, pageObj) {
                            //js代码
                            //在此处再一次调用queryActivityByConditionForPage函数是因为在用户使用跳转页面时可以将跳转后的页面数据传给该函数使得
                            //后端数据库能够与前端分页功能同步，将后端页面显示出来
                            //注意：这里虽然出现了函数调用再次调用自己的情况，但是不会出粗是因为，再次调用是有要求的，必须是用户每次切换页号
                            queryActivityByConditionForPage(pageObj.currentPage, pageObj.rowsPerPage);
                        }
                    });
                }
            });
        }

    </script>
</head>
<body>
<!-- 创建线索的模态窗口 -->
<div class="modal fade" id="createClueModal" role="dialog">
    <div class="modal-dialog" role="document" style="width: 90%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">创建线索</h4>
            </div>
            <div class="modal-body">
                <form id="createClueFrom" class="form-horizontal" role="form">

                    <div class="form-group">
                        <label for="create-Owner" class="col-sm-2 control-label">所有者<span
                                style="font-size: 15px; color: red;">*</span></label>
                        <div class="col-sm-10" style="width: 300px;">
                            <select class="form-control" id="create-owner">
                                <c:forEach items="${userList}" var="us">
                                    <option value="${us.id}">${us.name}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <label for="create-company" class="col-sm-2 control-label">公司<span
                                style="font-size: 15px; color: red;">*</span></label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="create-company">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="create-appellation" class="col-sm-2 control-label">称呼</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <select class="form-control" id="create-appellation">
                                <c:forEach items="${appellationList}" var="al">
                                    <option value="${al.id}">${al.value}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <label for="create-fullname" class="col-sm-2 control-label">姓名<span
                                style="font-size: 15px; color: red;">*</span></label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="create-fullname">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="create-job" class="col-sm-2 control-label">职位</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="create-job">
                        </div>
                        <label for="create-email" class="col-sm-2 control-label">邮箱</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="create-email">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="create-phone" class="col-sm-2 control-label">公司座机</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="create-phone">
                        </div>
                        <label for="create-website" class="col-sm-2 control-label">公司网站</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="create-website">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="create-mphone" class="col-sm-2 control-label">手机</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="create-mphone">
                        </div>
                        <label for="create-state" class="col-sm-2 control-label">线索状态</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <select class="form-control" id="create-state">
                                <c:forEach items="${clueStateList}" var="cs">
                                    <option value="${cs.id}">${cs.value}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="create-source" class="col-sm-2 control-label">线索来源</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <select class="form-control" id="create-source">
                                <c:forEach items="${sourceList}" var="sl">
                                    <option value="${sl.id}">${sl.value}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="create-describe" class="col-sm-2 control-label">线索描述</label>
                        <div class="col-sm-10" style="width: 81%;">
                            <textarea class="form-control" rows="3" id="create-describe"></textarea>
                        </div>
                    </div>

                    <div style="height: 1px; width: 103%; background-color: #D5D5D5; left: -13px; position: relative;"></div>

                    <div style="position: relative;top: 15px;">
                        <div class="form-group">
                            <label for="create-contactSummary" class="col-sm-2 control-label">联系纪要</label>
                            <div class="col-sm-10" style="width: 81%;">
                                <textarea class="form-control" rows="3" id="create-contactSummary"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="create-nextContactTime" class="col-sm-2 control-label">下次联系时间</label>
                            <div class="col-sm-10" style="width: 300px;">
                                <input type="text" class="form-control" id="create-nextContactTime">
                            </div>
                        </div>
                    </div>

                    <div style="height: 1px; width: 103%; background-color: #D5D5D5; left: -13px; position: relative; top : 10px;"></div>

                    <div style="position: relative;top: 20px;">
                        <div class="form-group">
                            <label for="create-address" class="col-sm-2 control-label">详细地址</label>
                            <div class="col-sm-10" style="width: 81%;">
                                <textarea class="form-control" rows="1" id="create-address"></textarea>
                            </div>
                        </div>
                    </div>
                </form>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="saveClueBtn">保存</button>
            </div>
        </div>
    </div>
</div>

<!-- 修改线索的模态窗口 -->
<div class="modal fade" id="editClueModal" role="dialog">
    <div class="modal-dialog" role="document" style="width: 90%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title">修改线索</h4>
            </div>
            <div class="modal-body">
                <!--这里添加了一个隐藏域用于储存id-->
                <input type="hidden" id="edit-id"/>
                <form class="form-horizontal" role="form">

                    <div class="form-group">
                        <label for="edit-clueOwner" class="col-sm-2 control-label">所有者<span
                                style="font-size: 15px; color: red;">*</span></label>
                        <div class="col-sm-10" style="width: 300px;">
                            <select class="form-control" id="edit-clueOwner">
                                <c:forEach items="${userList}" var="us">
                                    <option value="${us.id}">${us.name}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <label for="edit-company" class="col-sm-2 control-label">公司<span
                                style="font-size: 15px; color: red;">*</span></label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="edit-company" value="动力节点">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="edit-call" class="col-sm-2 control-label">称呼</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <select class="form-control" id="edit-call">
                                <c:forEach items="${appellationList}" var="al">
                                    <option value="${al.id}">${al.value}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <label for="edit-surname" class="col-sm-2 control-label">姓名<span
                                style="font-size: 15px; color: red;">*</span></label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="edit-surname" value="李四">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="edit-job" class="col-sm-2 control-label">职位</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="edit-job" value="CTO">
                        </div>
                        <label for="edit-email" class="col-sm-2 control-label">邮箱</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="edit-email" value="lisi@bjpowernode.com">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="edit-phone" class="col-sm-2 control-label">公司座机</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="edit-phone" value="010-84846003">
                        </div>
                        <label for="edit-website" class="col-sm-2 control-label">公司网站</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="edit-website"
                                   value="http://www.bjpowernode.com">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="edit-mphone" class="col-sm-2 control-label">手机</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <input type="text" class="form-control" id="edit-mphone" value="12345678901">
                        </div>
                        <label for="edit-status" class="col-sm-2 control-label">线索状态</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <select class="form-control" id="edit-status">
                                <c:forEach items="${clueStateList}" var="cs">
                                    <option value="${cs.id}">${cs.value}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="edit-source" class="col-sm-2 control-label">线索来源</label>
                        <div class="col-sm-10" style="width: 300px;">
                            <select class="form-control" id="edit-source">
                                <c:forEach items="${sourceList}" var="sl">
                                    <option value="${sl.id}">${sl.value}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="edit-description" class="col-sm-2 control-label">描述</label>
                        <div class="col-sm-10" style="width: 81%;">
                            <textarea class="form-control" rows="3"
                                      id="edit-description">这是一条线索的描述</textarea>
                        </div>
                    </div>

                    <div style="height: 1px; width: 103%; background-color: #D5D5D5; left: -13px; position: relative;"></div>

                    <div style="position: relative;top: 15px;">
                        <div class="form-group">
                            <label for="edit-contactSummary" class="col-sm-2 control-label">联系纪要</label>
                            <div class="col-sm-10" style="width: 81%;">
                                <textarea class="form-control" rows="3"
                                          id="edit-contactSummary">这个线索即将被转换</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="create-nextContactTime" class="col-sm-2 control-label">下次联系时间</label>
                            <div class="col-sm-10" style="width: 300px;">
                                <input type="text" class="form-control" id="edit-nextContactTime" value="2017-05-01">
                            </div>
                        </div>
                    </div>

                    <div style="height: 1px; width: 103%; background-color: #D5D5D5; left: -13px; position: relative; top : 10px;"></div>

                    <div style="position: relative;top: 20px;">
                        <div class="form-group">
                            <label for="edit-address" class="col-sm-2 control-label">详细地址</label>
                            <div class="col-sm-10" style="width: 81%;">
                                <textarea class="form-control" rows="1"
                                          id="edit-address">北京大兴区大族企业湾</textarea>
                            </div>
                        </div>
                    </div>
                </form>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="saveUpdateClueBtn">更新</button>
            </div>
        </div>
    </div>
</div>


<div>
    <div style="position: relative; left: 10px; top: -10px;">
        <div class="page-header">
            <h3>线索列表</h3>
        </div>
    </div>
</div>

<div style="position: relative; top: -20px; left: 0px; width: 100%; height: 100%;">

    <div style="width: 100%; position: absolute;top: 5px; left: 10px;">

        <div class="btn-toolbar" role="toolbar" style="height: 80px;">
            <form class="form-inline" role="form" style="position: relative;top: 8%; left: 5px;">

                <div class="form-group">
                    <div class="input-group">
                        <div class="input-group-addon">名称</div>
                        <input class="form-control" type="text" id="query-fullname">
                    </div>
                </div>

                <div class="form-group">
                    <div class="input-group">
                        <div class="input-group-addon">公司</div>
                        <input class="form-control" type="text" id="query-company">
                    </div>
                </div>

                <div class="form-group">
                    <div class="input-group">
                        <div class="input-group-addon">公司座机</div>
                        <input class="form-control" type="text" id="query-phone">
                    </div>
                </div>

                <div class="form-group">
                    <div class="input-group">
                        <div class="input-group-addon">线索来源</div>
                        <select class="form-control" id="query-source">
                            <c:forEach items="${sourceList}" var="sl">
                                <option value="${sl.id}">${sl.value}</option>
                            </c:forEach>
                        </select>
                    </div>
                </div>

                <br>

                <div class="form-group">
                    <div class="input-group">
                        <div class="input-group-addon">所有者</div>
                        <input class="form-control" type="text" id="query-owner">
                    </div>
                </div>


                <div class="form-group">
                    <div class="input-group">
                        <div class="input-group-addon">手机</div>
                        <input class="form-control" type="text" id="query-mphone">
                    </div>
                </div>

                <div class="form-group">
                    <div class="input-group">
                        <div class="input-group-addon">线索状态</div>
                        <select class="form-control" id="query-state">
                            <c:forEach items="${clueStateList}" var="cs">
                                <option value="${cs.id}">${cs.value}</option>
                            </c:forEach>
                        </select>
                    </div>
                </div>

                <button type="button" class="btn btn-default" id="queryClueBtn">查询</button>

            </form>
        </div>
        <div class="btn-toolbar" role="toolbar"
             style="background-color: #F7F7F7; height: 50px; position: relative;top: 40px;">
            <div class="btn-group" style="position: relative; top: 18%;">
                <button type="button" id="createBtn" class="btn btn-primary"
                        data-target="#createClueModal"><span
                        class="glyphicon glyphicon-plus"></span> 创建
                </button>
                <button type="button" id="editBtn" class="btn btn-default"
                        data-target="#editClueModal"><span
                        class="glyphicon glyphicon-pencil"></span> 修改
                </button>
                <button type="button" id="deleteClueBtn" class="btn btn-danger">
                    <span class="glyphicon glyphicon-minus"></span> 删除
                </button>
            </div>


        </div>
        <div style="position: relative;top: 50px;">
            <table class="table table-hover">
                <thead>
                <tr style="color: #B3B3B3;">
                    <td><input type="checkbox" id="checkedAll"/></td>
                    <td>名称</td>
                    <td>公司</td>
                    <td>公司座机</td>
                    <td>手机</td>
                    <td>线索来源</td>
                    <td>所有者</td>
                    <td>线索状态</td>
                </tr>
                </thead>
                <tbody id="tBody">
                <%--                <tr class="active">--%>
                <%--                    <td><input type="checkbox"/></td>--%>
                <%--                    <td><a style="text-decoration: none; cursor: pointer;"--%>
                <%--                           onclick="window.location.href='detail.jsp';">李四先生</a></td>--%>
                <%--                    <td>动力节点</td>--%>
                <%--                    <td>010-84846003</td>--%>
                <%--                    <td>12345678901</td>--%>
                <%--                    <td>广告</td>--%>
                <%--                    <td>zhangsan</td>--%>
                <%--                    <td>已联系</td>--%>
                <%--                </tr>--%>
                </tbody>
            </table>
        </div>

        <!--使用bootStrap的分页功能-->
        <div style="height: 50px; position: relative;top: 60px;">
            <div id="cluePage"></div>
            <div>
                <%--                <button type="button" class="btn btn-default" style="cursor: default;">共<b>50</b>条记录</button>--%>
                <%--            </div>--%>
                <%--            <div class="btn-group" style="position: relative;top: -34px; left: 110px;">--%>
                <%--                <button type="button" class="btn btn-default" style="cursor: default;">显示</button>--%>
                <%--                <div class="btn-group">--%>
                <%--                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">--%>
                <%--                        10--%>
                <%--                        <span class="caret"></span>--%>
                <%--                    </button>--%>
                <%--                    <ul class="dropdown-menu" role="menu">--%>
                <%--                        <li><a href="#">20</a></li>--%>
                <%--                        <li><a href="#">30</a></li>--%>
                <%--                    </ul>--%>
                <%--                </div>--%>
                <%--                <button type="button" class="btn btn-default" style="cursor: default;">条/页</button>--%>
                <%--            </div>--%>
                <%--            <div style="position: relative;top: -88px; left: 285px;">--%>
                <%--                <nav>--%>
                <%--                    <ul class="pagination">--%>
                <%--                        <li class="disabled"><a href="#">首页</a></li>--%>
                <%--                        <li class="disabled"><a href="#">上一页</a></li>--%>
                <%--                        <li class="active"><a href="#">1</a></li>--%>
                <%--                        <li><a href="#">2</a></li>--%>
                <%--                        <li><a href="#">3</a></li>--%>
                <%--                        <li><a href="#">4</a></li>--%>
                <%--                        <li><a href="#">5</a></li>--%>
                <%--                        <li><a href="#">下一页</a></li>--%>
                <%--                        <li class="disabled"><a href="#">末页</a></li>--%>
                <%--                    </ul>--%>
                <%--                </nav>--%>
                <%--            </div>--%>
                <%--        </div>--%>

            </div>

        </div>
    </div>
</div>
</body>
</html>